READ

Syntax: READ var1 *[vari]*
Location: QL ROM

This command forces the interpreter to look at the current data pointer, that is to say the next program line which begins with the marker DATA. 

When a program is first RUN, the data pointer is set to the start of the program, and hence READ will attempt to assign the first value following the first occurrence of DATA to the specified variable. 

Having assigned this value, the data pointer is updated to the next value in the same DATA statement, or the next program line if there are no more values following the DATA statement.

If no more DATA is contained within the program and you try to READ a value, the error 'End of File' is reported.

MINERVA NOTE:
As from v1.96, READ has been improved so that it will accept an array parameter and then read a value for each element of the array in turn, without having to put READ into a loop.

Example:
100 DIM x(5)
110 READ x
1000 DATA 1,2,3,4,5,6

This will read x(0), x(1), x(2), x(3), x(4) and x(5)

CROSS-REFERENCE:
RESTORE allows you to alter the program line pointed at by the data pointer.
DATA sets out lines to be READ.  
EOF allows you to test for the end of all program data.
